
// 函数组合 调试 
// NEVER SAY DIE  --> never-say-die

const _ = require('lodash')

// _.split()
const split = _.curry((sep, str) => _.split(str, sep))

// _.toLower()
const join = _.curry((sep, array) => _.join(array, sep))

const log = (v)=>{
  console.log(v)
  return v
 }

const trace = _.curry((str,v)=>{
  console.log(str,v)
  return v
})

const map = _.curry((fn, array)=> _.map(array,fn))

const f = _.flowRight(join('-'),trace("map之后"),map(_.toLower),trace('map之前'),split(' '))

console.log(f('NEVER SAY DIE'))
